﻿<fundamentals:OfficeWindow x:Class="Modern.FileBrowser.FileDialog"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Modern.FileBrowser"
		xmlns:fundamentals="clr-namespace:Daytimer.Fundamentals;assembly=Daytimer.Fundamentals"
		xmlns:customListView="clr-namespace:Modern.FileBrowser.CustomListView" Title="File Dialog" Height="520"
		Width="660" MinHeight="304" MinWidth="623" UseLayoutRounding="True" WindowStartupLocation="CenterOwner"
		TextOptions.TextFormattingMode="Display" ShowInTaskbar="False">
	<fundamentals:OfficeWindow.Resources>
		<ResourceDictionary>
			<ResourceDictionary.MergedDictionaries>
				<ResourceDictionary Source="Resources/TreeView.xaml" />
				<ResourceDictionary Source="Resources/ListView.xaml" />
				<ResourceDictionary Source="Resources/NavigationButtons.xaml" />
			</ResourceDictionary.MergedDictionaries>
			<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
			<local:InverseBooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" />
			<!--<local:FileToIconConverter x:Key="FileToIconConverter" />-->
			<local:FileSizeConverter x:Key="FileSizeConverter" />
			<local:DateTimeConverter x:Key="DateTimeConverter" />
			<DataTemplate x:Key="TreeViewItemTemplate" DataType="local:FileSystemItemUI">
				<StackPanel Orientation="Horizontal">
					<Image x:Name="Image" Source="{Binding Icon16x16}" Stretch="None" Width="16" Height="16"
							VerticalAlignment="Center" />
					<TextBlock x:Name="Text" Text="{Binding Name}" Margin="5,0,0,0" VerticalAlignment="Center"
							TextTrimming="CharacterEllipsis" />
				</StackPanel>
			</DataTemplate>
			<DataTemplate x:Key="16x16PicCell">
				<Grid IsHitTestVisible="False">
					<Grid.ColumnDefinitions>
						<ColumnDefinition Width="23" />
						<ColumnDefinition />
					</Grid.ColumnDefinitions>
					<Image x:Name="Image" Stretch="None" Width="16" Height="16" Margin="3,0,4,0"
							VerticalAlignment="Center" Source="{Binding Icon16x16}" />
					<TextBlock x:Name="Text" Grid.Column="1" Text="{Binding Name}" Foreground="Black"
							VerticalAlignment="Center" TextTrimming="CharacterEllipsis" />
				</Grid>
				<DataTemplate.Triggers>
					<DataTrigger Binding="{Binding IsHidden, IsAsync=True}" Value="True">
						<Setter Property="Opacity" TargetName="Image" Value="0.5" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsSystem, IsAsync=True}" Value="True">
						<Setter Property="Opacity" TargetName="Image" Value="0.5" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsCompressed, IsAsync=True}" Value="True">
						<Setter Property="Foreground" TargetName="Text" Value="#0000FF" />
					</DataTrigger>
				</DataTemplate.Triggers>
			</DataTemplate>
			<DataTemplate x:Key="ContentCell">
				<Grid Height="47" Margin="3,0,30,0">
					<Grid x:Name="NormalItem">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="40" />
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition />
							<ColumnDefinition Width="180" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition />
							<RowDefinition />
						</Grid.RowDefinitions>
						<Image x:Name="Image" Stretch="None" Width="32" Height="32" Margin="0,0,8,0"
								VerticalAlignment="Center" Grid.RowSpan="2" Source="{Binding Icon32x32}" />
						<TextBlock x:Name="Text" Grid.Column="1" Grid.ColumnSpan="2" Text="{Binding Name}"
								Foreground="Black" VerticalAlignment="Top" FontSize="15"
								TextTrimming="CharacterEllipsis" Margin="0,4,10,-4" />
						<TextBlock x:Name="typeHeader" Grid.Column="1" Grid.Row="1" Text="Type: " Foreground="#6D6D6D"
								Margin="0,2,0,-2" Visibility="Collapsed" />
						<TextBlock x:Name="typeContent" Grid.Column="2" Grid.Row="1" Foreground="Black"
								TextTrimming="CharacterEllipsis" Margin="0,2,10,-2" Visibility="Collapsed" />
						<StackPanel x:Name="DateModified" Orientation="Horizontal" VerticalAlignment="Bottom"
								Grid.Column="3">
							<TextBlock Text="Date modified: " Foreground="#6D6D6D" />
							<TextBlock
									Text="{Binding DateModified, Converter={StaticResource DateTimeConverter}, IsAsync=True}"
									Foreground="Black" />
						</StackPanel>
						<StackPanel x:Name="Size" Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Top"
								Margin="0,2,0,-2" Grid.Column="3">
							<TextBlock Text="Size: " Foreground="#6D6D6D" />
							<TextBlock Text="{Binding Size, Converter={StaticResource FileSizeConverter}, IsAsync=True}"
									Foreground="Black" />
						</StackPanel>
					</Grid>
					<Grid x:Name="DriveItem" Visibility="Collapsed">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="40" />
							<ColumnDefinition />
							<ColumnDefinition Width="180" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition />
							<RowDefinition />
						</Grid.RowDefinitions>
						<Image Stretch="{Binding Stretch, ElementName=Image}" Width="32" Height="32" Margin="0,0,8,0"
								VerticalAlignment="Center" Grid.RowSpan="2" Source="{Binding Source, ElementName=Image}" />
						<TextBlock Grid.Column="1" Text="{Binding Name}" Foreground="Black" VerticalAlignment="Top"
								FontSize="15" TextTrimming="CharacterEllipsis" Margin="0,4,13,-4" />
						<ProgressBar x:Name="driveProgressBar" Grid.Row="1" Grid.Column="1" Height="13"
								Maximum="{Binding Size, Mode=OneWay}" Value="{Binding UsedSpace, Mode=OneWay}"
								Margin="0,0,13,0" Background="#26A0DA">
							<ProgressBar.Template>
								<ControlTemplate TargetType="{x:Type ProgressBar}">
									<Border x:Name="PART_Track" BorderBrush="#BCBCBC" BorderThickness="1"
											Background="#E6E6E6">
										<Border x:Name="PART_Indicator" Background="{TemplateBinding Background}" HorizontalAlignment="Left" />
									</Border>
								</ControlTemplate>
							</ProgressBar.Template>
						</ProgressBar>
						<TextBlock x:Name="driveFormat" Grid.Column="2" Text="{Binding DriveFormat}" Foreground="Black"
								VerticalAlignment="Bottom" Margin="0,1,0,-1" />
						<StackPanel x:Name="driveStackPanel" Grid.Column="2" Grid.Row="1" VerticalAlignment="Center"
								Orientation="Horizontal" TextElement.Foreground="Black" Margin="0,-2,0,2">
							<TextBlock
									Text="{Binding FreeSpace, Converter={StaticResource FileSizeConverter}, IsAsync=True}" />
							<TextBlock Text=" free of " />
							<TextBlock Text="{Binding Size, Converter={StaticResource FileSizeConverter}, IsAsync=True}" />
						</StackPanel>
					</Grid>
				</Grid>
				<DataTemplate.Triggers>
					<DataTrigger Binding="{Binding Icon32x32}" Value="{x:Null}">
						<Setter Property="Source" TargetName="Image" Value="{Binding PlaceholderIcon, IsAsync=True}" />
						<Setter Property="Stretch" TargetName="Image" Value="Fill" />
						<Setter Property="RenderOptions.BitmapScalingMode" TargetName="Image" Value="NearestNeighbor" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsHidden, IsAsync=True}" Value="True">
						<Setter Property="Opacity" TargetName="Image" Value="0.5" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsSystem, IsAsync=True}" Value="True">
						<Setter Property="Opacity" TargetName="Image" Value="0.5" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsCompressed, IsAsync=True}" Value="True">
						<Setter Property="Foreground" TargetName="Text" Value="#0000FF" />
					</DataTrigger>
					<DataTrigger Binding="{Binding DateModified}" Value="{x:Null}">
						<Setter Property="Visibility" TargetName="DateModified" Value="Collapsed" />
					</DataTrigger>
					<DataTrigger Binding="{Binding Size}" Value="{x:Null}">
						<Setter Property="Visibility" TargetName="Size" Value="Collapsed" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsRecognizedExtension, IsAsync=True}" Value="False">
						<Setter Property="Text" TargetName="typeContent" Value="{Binding DisplayType, IsAsync=True}" />
						<Setter Property="Visibility" TargetName="typeHeader" Value="Visible" />
						<Setter Property="Visibility" TargetName="typeContent" Value="Visible" />
					</DataTrigger>
					<DataTrigger Binding="{Binding FileSystemItemType}" Value="Drive">
						<Setter Property="Visibility" TargetName="DriveItem" Value="Visible" />
						<Setter Property="Visibility" TargetName="NormalItem" Value="Collapsed" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsDriveReady}" Value="False">
						<Setter Property="Visibility" TargetName="driveFormat" Value="Collapsed" />
						<Setter Property="Visibility" TargetName="driveStackPanel" Value="Collapsed" />
						<Setter Property="Visibility" TargetName="driveProgressBar" Value="Collapsed" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsDriveFull}" Value="True">
						<Setter Property="Background" TargetName="driveProgressBar" Value="#DA2626" />
					</DataTrigger>
				</DataTemplate.Triggers>
			</DataTemplate>
			<DataTemplate x:Key="96x96Cell">
				<Grid Margin="3,2">
					<Grid.RowDefinitions>
						<RowDefinition />
						<RowDefinition Height="Auto" />
					</Grid.RowDefinitions>
					<Image x:Name="Image" Stretch="None" MaxWidth="90" MaxHeight="90" VerticalAlignment="Center"
							HorizontalAlignment="Center" Source="{Binding Icon96x96}" />
					<TextBlock x:Name="Text" Grid.Row="1" Text="{Binding Name}" Foreground="Black"
							HorizontalAlignment="Center" VerticalAlignment="Top" TextTrimming="CharacterEllipsis"
							TextWrapping="Wrap" TextAlignment="Center" Margin="0,2,0,0" MaxHeight="64" />
				</Grid>
				<DataTemplate.Triggers>
					<DataTrigger Binding="{Binding Icon96x96}" Value="{x:Null}">
						<Setter Property="Source" TargetName="Image" Value="{Binding PlaceholderIcon, IsAsync=True}" />
						<Setter Property="Stretch" TargetName="Image" Value="Fill" />
						<Setter Property="RenderOptions.BitmapScalingMode" TargetName="Image" Value="NearestNeighbor" />
						<Setter Property="Width" TargetName="Image" Value="90" />
						<Setter Property="Height" TargetName="Image" Value="90" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsHidden, IsAsync=True}" Value="True">
						<Setter Property="Opacity" TargetName="Image" Value="0.5" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsSystem, IsAsync=True}" Value="True">
						<Setter Property="Opacity" TargetName="Image" Value="0.5" />
					</DataTrigger>
					<DataTrigger Binding="{Binding IsCompressed, IsAsync=True}" Value="True">
						<Setter Property="Foreground" TargetName="Text" Value="#0000FF" />
					</DataTrigger>
				</DataTemplate.Triggers>
			</DataTemplate>
			<GridView x:Key="DetailsView" AllowsColumnReorder="False">
				<GridViewColumn Width="272" CellTemplate="{StaticResource 16x16PicCell}"
						HeaderContainerStyle="{StaticResource HeaderTemplateArrowUp}">
					<GridViewColumn.Header>
						<GridViewColumnHeader Padding="15,0" Content="Name" Tag="FullName"
								local:FileDialog.DefaultSortDirection="Ascending" />
					</GridViewColumn.Header>
				</GridViewColumn>
				<GridViewColumn Width="128"
						DisplayMemberBinding="{Binding DateModified, Converter={StaticResource DateTimeConverter}, IsAsync=True}">
					<GridViewColumn.Header>
						<GridViewColumnHeader Content="Date modified" Tag="DateModified"
								local:FileDialog.DefaultSortDirection="Descending" />
					</GridViewColumn.Header>
				</GridViewColumn>
				<GridViewColumn Width="118" DisplayMemberBinding="{Binding DisplayType, IsAsync=True}">
					<GridViewColumn.Header>
						<GridViewColumnHeader Content="Type" Tag="DisplayType"
								local:FileDialog.DefaultSortDirection="Ascending" />
					</GridViewColumn.Header>
				</GridViewColumn>
				<GridViewColumn Width="74">
					<GridViewColumn.Header>
						<GridViewColumnHeader Content="Size" Tag="Size"
								local:FileDialog.DefaultSortDirection="Descending" />
					</GridViewColumn.Header>
					<GridViewColumn.CellTemplate>
						<DataTemplate>
							<TextBlock Text="{Binding Size, Converter={StaticResource FileSizeConverter}, IsAsync=True}"
									HorizontalAlignment="Right" />
						</DataTemplate>
					</GridViewColumn.CellTemplate>
				</GridViewColumn>
			</GridView>
			<customListView:WrapView x:Key="LargeIconView" ItemTemplate="{StaticResource 96x96Cell}" ItemWidth="126"
					ItemHeight="1.79769e+308">
				<customListView:WrapView.ItemContainerStyle>
					<Style TargetType="ListViewItem">
						<EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick" />
						<EventSetter Event="ContextMenuOpening" Handler="ListViewItem_ContextMenuOpening" />
						<Setter Property="Width" Value="104" />
						<!--<Setter Property="MinHeight" Value="116" />-->
						<Setter Property="Margin" Value="0,0,14,1" />
						<Setter Property="Template">
							<Setter.Value>
								<ControlTemplate TargetType="ListBoxItem">
									<Border x:Name="Border" BorderThickness="1" BorderBrush="Transparent"
											SnapsToDevicePixels="True" Background="Transparent">
										<ContentPresenter IsHitTestVisible="False" />
									</Border>
									<ControlTemplate.Triggers>
										<MultiTrigger>
											<MultiTrigger.Conditions>
												<Condition Property="IsMouseOver" Value="True" />
											</MultiTrigger.Conditions>
											<Setter Property="Background" TargetName="Border" Value="#1F26A0DA" />
											<Setter Property="BorderBrush" TargetName="Border" Value="#A826A0DA" />
										</MultiTrigger>
										<MultiTrigger>
											<MultiTrigger.Conditions>
												<Condition Property="Selector.IsSelectionActive" Value="False" />
												<Condition Property="IsSelected" Value="True" />
											</MultiTrigger.Conditions>
											<Setter Property="Background" TargetName="Border" Value="#3DDADADA" />
											<Setter Property="BorderBrush" TargetName="Border" Value="#FFDADADA" />
										</MultiTrigger>
										<MultiTrigger>
											<MultiTrigger.Conditions>
												<Condition Property="Selector.IsSelectionActive" Value="True" />
												<Condition Property="IsSelected" Value="True" />
											</MultiTrigger.Conditions>
											<Setter Property="Background" TargetName="Border" Value="#3D26A0DA" />
											<Setter Property="BorderBrush" TargetName="Border" Value="#FF26A0DA" />
										</MultiTrigger>
										<Trigger Property="IsEnabled" Value="False">
											<Setter Property="TextElement.Foreground" TargetName="Border"
													Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
										</Trigger>
									</ControlTemplate.Triggers>
								</ControlTemplate>
							</Setter.Value>
						</Setter>
						<Setter Property="FocusVisualStyle">
							<Setter.Value>
								<Style />
							</Setter.Value>
						</Setter>
					</Style>
				</customListView:WrapView.ItemContainerStyle>
			</customListView:WrapView>
			<customListView:ListBoxView x:Key="ContentView" ItemTemplate="{StaticResource ContentCell}">
				<customListView:ListBoxView.ItemContainerStyle>
					<Style TargetType="ListViewItem">
						<EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick" />
						<EventSetter Event="ContextMenuOpening" Handler="ListViewItem_ContextMenuOpening" />
						<Setter Property="Margin" Value="0,0,0,-1" />
						<Setter Property="Width"
								Value="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType=ScrollContentPresenter}}" />
						<Setter Property="FocusVisualStyle" Value="{x:Null}" />
						<Setter Property="Template">
							<Setter.Value>
								<ControlTemplate TargetType="ListBoxItem">
									<Border x:Name="Border" BorderThickness="1" BorderBrush="Transparent"
											SnapsToDevicePixels="True" Background="Transparent" Margin="0,0,2,0">
										<ContentPresenter IsHitTestVisible="False" />
									</Border>
									<ControlTemplate.Triggers>
										<MultiTrigger>
											<MultiTrigger.Conditions>
												<Condition Property="IsMouseOver" Value="True" />
											</MultiTrigger.Conditions>
											<Setter Property="Background" TargetName="Border" Value="#1F26A0DA" />
											<Setter Property="BorderBrush" TargetName="Border" Value="#A826A0DA" />
											<Setter Property="Panel.ZIndex" Value="2" />
										</MultiTrigger>
										<MultiTrigger>
											<MultiTrigger.Conditions>
												<Condition Property="Selector.IsSelectionActive" Value="False" />
												<Condition Property="IsSelected" Value="True" />
											</MultiTrigger.Conditions>
											<Setter Property="Background" TargetName="Border" Value="#3DDADADA" />
											<Setter Property="BorderBrush" TargetName="Border" Value="#FFDADADA" />
										</MultiTrigger>
										<MultiTrigger>
											<MultiTrigger.Conditions>
												<Condition Property="Selector.IsSelectionActive" Value="True" />
												<Condition Property="IsSelected" Value="True" />
											</MultiTrigger.Conditions>
											<Setter Property="Background" TargetName="Border" Value="#3D26A0DA" />
											<Setter Property="BorderBrush" TargetName="Border" Value="#FF26A0DA" />
										</MultiTrigger>
										<Trigger Property="IsEnabled" Value="False">
											<Setter Property="TextElement.Foreground" TargetName="Border"
													Value="{StaticResource {x:Static SystemColors.GrayTextBrushKey}}" />
										</Trigger>
										<Trigger Property="IsSelected" Value="True">
											<Setter Property="Panel.ZIndex" Value="1" />
										</Trigger>
									</ControlTemplate.Triggers>
								</ControlTemplate>
							</Setter.Value>
						</Setter>
					</Style>
				</customListView:ListBoxView.ItemContainerStyle>
			</customListView:ListBoxView>
		</ResourceDictionary>
	</fundamentals:OfficeWindow.Resources>
	<Grid>
		<Grid.ColumnDefinitions>
			<!-- Tree -->
			<ColumnDefinition MinWidth="65" Width="170*" />
			<!-- Main -->
			<ColumnDefinition MinWidth="133" Width="500*" />
		</Grid.ColumnDefinitions>
		<Grid.RowDefinitions>
			<!-- Menu -->
			<RowDefinition Height="Auto" />
			<!-- Navs -->
			<RowDefinition Height="Auto" />
			<!-- Secondary Controls -->
			<RowDefinition Height="31" />
			<!-- Main -->
			<RowDefinition />
			<!-- Dialog-Specific UI -->
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<!-- Navs -->
		<Grid Grid.ColumnSpan="2" Grid.Row="1" Margin="0,5,0,7">
			<Grid.ColumnDefinitions>
				<!-- Back -->
				<ColumnDefinition Width="Auto" />
				<!-- Forward -->
				<ColumnDefinition Width="Auto" />
				<!-- Up -->
				<ColumnDefinition Width="Auto" />
				<!-- Breadcrumb -->
				<ColumnDefinition />
				<!-- Refresh -->
				<ColumnDefinition Width="Auto" />
				<!-- Search -->
				<ColumnDefinition Width="Auto" />
			</Grid.ColumnDefinitions>
			<Button x:Name="back" Style="{StaticResource HistoryButton}" Margin="6,0,0,0"
					Content="M -0.5 4.125 3.75 0.25 6 0.25 6 1.25 3.25 3.75 9.75 3.75 9.75 6 3.25 6 6 8.25 6 9.5 4 9.5 -0.5 5.5 Z"
					Command="BrowseBack" ToolTip="Back (Alt + Left Arrow)" />
			<Button x:Name="forward" Grid.Column="1" Style="{StaticResource HistoryButton}"
					Content="M 10 4.125 5.75 0.25 3.5 0.25 3.5 1.25 6.25 3.75 -0.25 3.75 -0.25 6 6.25 6 3.5 8.25 3.5 9.5 5.5 9.5 10 5.5 Z"
					Command="BrowseForward" ToolTip="Forward (Alt + Right Arrow)" />
			<Button x:Name="up" Grid.Column="2" Style="{StaticResource UpButton}" Margin="4,0,1,0"
					Command="local:FileDialog.BrowseUpCommand" ToolTip="Up (Alt + Up Arrow)" />
			<local:Breadcrumb x:Name="breadcrumb" Grid.Column="3" Navigate="breadcrumb_Navigate">
				<local:BreadcrumbButton x:Name="expanderButton" Width="15"
						DropDownButtonExpandedData="{Binding DropDownButtonData, RelativeSource={RelativeSource Self}}"
						Visibility="{Binding HasHiddenItems, ElementName=breadcrumb, Converter={StaticResource BooleanToVisibilityConverter}}">
					<local:BreadcrumbButton.DropDownButtonData>
						<local:PathData Stroke="#808080" StrokeThickness="1"
								Data="M 2.5 0 0 2.5 2.5 5 M 6.5 0 4 2.5 6.5 5" />
					</local:BreadcrumbButton.DropDownButtonData>
				</local:BreadcrumbButton>
			</local:Breadcrumb>
			<Button x:Name="refresh" Style="{StaticResource RefreshButton}" Grid.Column="4" Margin="-1,0,12,0"
					Command="Refresh" ToolTip="Refresh (F5)" />
		</Grid>
		<!-- Secondary Controls Background -->
		<Border Background="#F5F6F7" BorderThickness="0,0,0,1" BorderBrush="#E8E9EA" Grid.ColumnSpan="2" Grid.Row="2" />
		<!-- View Selector -->
		<StackPanel Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center"
				Orientation="Horizontal" Margin="5,0">
			<StackPanel.Resources>
				<Style TargetType="RadioButton">
					<Setter Property="Width" Value="22" />
					<Setter Property="Height" Value="23" />
					<Setter Property="Margin" Value="1,0,0,0" />
					<Setter Property="Template">
						<Setter.Value>
							<ControlTemplate TargetType="RadioButton">
								<Border x:Name="border" BorderThickness="1" BorderBrush="Transparent"
										Background="Transparent">
									<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
								</Border>
								<ControlTemplate.Triggers>
									<Trigger Property="IsMouseOver" Value="True">
										<Setter Property="BorderBrush" TargetName="border" Value="#70C0E7" />
										<Setter Property="Background" TargetName="border" Value="#E5F3FB" />
									</Trigger>
									<Trigger Property="IsChecked" Value="True">
										<Setter Property="BorderBrush" TargetName="border" Value="#26A0DA" />
										<Setter Property="Background" TargetName="border" Value="#CBE8F6" />
									</Trigger>
								</ControlTemplate.Triggers>
							</ControlTemplate>
						</Setter.Value>
					</Setter>
				</Style>
			</StackPanel.Resources>
			<RadioButton x:Name="detailsSelector" ToolTip="Details" Checked="detailsSelector_Checked">
				<Image Stretch="None" Source="Images/details_selector.png" />
			</RadioButton>
			<RadioButton x:Name="contentSelector" ToolTip="Content" Checked="contentSelector_Checked">
				<Image Stretch="None" Source="Images/content_selector.png" />
			</RadioButton>
			<RadioButton x:Name="largeIconSelector" ToolTip="Large Icons" Checked="largeIconSelector_Checked">
				<Image Stretch="None" Source="Images/largeIcon_selector.png" />
			</RadioButton>
		</StackPanel>
		<!-- Tree -->
		<TreeView x:Name="treeView" Grid.Row="3" BorderThickness="0" Margin="0,0,3,0">
			<TreeView.Resources>
				<Style TargetType="TreeViewItem" BasedOn="{StaticResource TreeViewItem}">
					<EventSetter Event="MouseLeftButtonUp" Handler="TreeViewItem_MouseLeftButtonUp" />
				</Style>
			</TreeView.Resources>
			<TreeViewItem x:Name="favoritesHeader" ItemTemplate="{StaticResource TreeViewItemTemplate}" Margin="0,15">
				<TreeViewItem.Header>
					<StackPanel Orientation="Horizontal">
						<Image Source="Images/favorites_16.png" Stretch="None" VerticalAlignment="Center" />
						<TextBlock Text="Favorites" Margin="5,0,0,0" VerticalAlignment="Center" />
					</StackPanel>
				</TreeViewItem.Header>
			</TreeViewItem>
			<TreeViewItem x:Name="thisPCHeader" ItemTemplate="{StaticResource TreeViewItemTemplate}" Margin="0,15">
				<TreeViewItem.Header>
					<StackPanel Orientation="Horizontal">
						<Image Source="Images/computer_16.png" Stretch="None" VerticalAlignment="Center" />
						<TextBlock Text="This PC" Margin="5,0,0,0" VerticalAlignment="Center" />
					</StackPanel>
				</TreeViewItem.Header>
			</TreeViewItem>
			<TreeViewItem x:Name="librariesHeader" ItemTemplate="{StaticResource TreeViewItemTemplate}"
					Margin="0,15,0,45">
				<TreeViewItem.Header>
					<StackPanel Orientation="Horizontal">
						<Image Source="Images/libraries_16.png" Stretch="None" VerticalAlignment="Center" />
						<TextBlock Text="Libraries" Margin="5,0,0,0" VerticalAlignment="Center" />
					</StackPanel>
				</TreeViewItem.Header>
			</TreeViewItem>
		</TreeView>
		<GridSplitter Grid.Row="3" HorizontalAlignment="Right" Width="3" ResizeBehavior="CurrentAndNext">
			<GridSplitter.Template>
				<ControlTemplate TargetType="GridSplitter">
					<Border Background="Transparent">
						<Border Background="#F7F7F7" Width="1" IsHitTestVisible="False" />
					</Border>
				</ControlTemplate>
			</GridSplitter.Template>
		</GridSplitter>
		<!-- Main -->
		<ListView x:Name="listView" Grid.Column="1" Grid.Row="3" SelectionChanged="listView_SelectionChanged"
				GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler">
			<ListView.Resources>
				<Style TargetType="ListViewItem" BasedOn="{StaticResource ListViewItemKey}">
					<Setter Property="Margin" Value="0,0,4,-1" />
					<EventSetter Event="MouseDoubleClick" Handler="ListViewItem_MouseDoubleClick" />
					<EventSetter Event="ContextMenuOpening" Handler="ListViewItem_ContextMenuOpening" />
				</Style>
			</ListView.Resources>
		</ListView>
		<TextBlock x:Name="emptyNotice" Grid.Column="1" Grid.Row="3" IsHitTestVisible="False"
				Text="No items match your search." TextWrapping="Wrap" HorizontalAlignment="Center"
				VerticalAlignment="Top" Margin="0,44,5,0" Foreground="#FF6D6D6D"
				Visibility="{Binding HasItems, ElementName=listView, Converter={StaticResource InverseBooleanToVisibilityConverter}}" />
		<!-- Dialog-Specific UI -->
		<Border Grid.Row="4" Grid.ColumnSpan="2" Background="#F0F0F0">
			<Grid Margin="17,10,17,13">
				<Grid.ColumnDefinitions>
					<ColumnDefinition />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
					<ColumnDefinition Width="Auto" />
				</Grid.ColumnDefinitions>
				<Grid.RowDefinitions>
					<RowDefinition />
					<RowDefinition />
				</Grid.RowDefinitions>
				<Button x:Name="okButton" Grid.Column="2" Grid.Row="1" Width="86" Height="24" Margin="0,7,12,0"
						VerticalAlignment="Bottom" IsEnabled="False" Click="okButton_Click" />
				<TextBlock HorizontalAlignment="Right" Margin="0,0,6,0" Text="File name:" IsHitTestVisible="False"
						VerticalAlignment="Center" />
				<ComboBox x:Name="fileNameCombo" Grid.Column="1" IsEditable="True" Width="218" Height="24"
						Margin="0,0,12,0" VerticalAlignment="Center"
						IsEnabled="{Binding IsEnabled, ElementName=okButton}" />
				<ComboBox x:Name="filterCombo" Grid.Column="2" Grid.ColumnSpan="2" Width="184" Height="24"
						VerticalAlignment="Center" IsEnabled="{Binding IsEnabled, ElementName=okButton}"
						SelectionChanged="filterCombo_SelectionChanged">
					<ComboBox.ItemTemplate>
						<DataTemplate DataType="local:FilterComboBoxItem">
							<TextBlock Text="{Binding DisplayText}" TextTrimming="CharacterEllipsis"
									VerticalAlignment="Center" />
						</DataTemplate>
					</ComboBox.ItemTemplate>
				</ComboBox>
				<Button x:Name="cancelButton" Grid.Column="3" Grid.Row="1" IsCancel="True" Content="Cancel" Width="86"
						Height="24" VerticalAlignment="Bottom" />
			</Grid>
		</Border>
	</Grid>
</fundamentals:OfficeWindow>
